# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Container.V1.Model.SecurityBulletinEvent do
  @moduledoc """
  SecurityBulletinEvent is a notification sent to customers when a security bulletin has been posted that they are vulnerable to.

  ## Attributes

  *   `affectedSupportedMinors` (*type:* `list(String.t)`, *default:* `nil`) - The GKE minor versions affected by this vulnerability.
  *   `briefDescription` (*type:* `String.t`, *default:* `nil`) - A brief description of the bulletin. See the bulletin pointed to by the bulletin_uri field for an expanded description.
  *   `bulletinId` (*type:* `String.t`, *default:* `nil`) - The ID of the bulletin corresponding to the vulnerability.
  *   `bulletinUri` (*type:* `String.t`, *default:* `nil`) - The URI link to the bulletin on the website for more information.
  *   `cveIds` (*type:* `list(String.t)`, *default:* `nil`) - The CVEs associated with this bulletin.
  *   `manualStepsRequired` (*type:* `boolean()`, *default:* `nil`) - If this field is specified, it means there are manual steps that the user must take to make their clusters safe.
  *   `mitigatedVersions` (*type:* `list(String.t)`, *default:* `nil`) - The GKE versions where this vulnerability is mitigated.
  *   `patchedVersions` (*type:* `list(String.t)`, *default:* `nil`) - The GKE versions where this vulnerability is patched.
  *   `resourceTypeAffected` (*type:* `String.t`, *default:* `nil`) - The resource type (node/control plane) that has the vulnerability. Multiple notifications (1 notification per resource type) will be sent for a vulnerability that affects > 1 resource type.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - The severity of this bulletin as it relates to GKE.
  *   `suggestedUpgradeTarget` (*type:* `String.t`, *default:* `nil`) - This represents a version selected from the patched_versions field that the cluster receiving this notification should most likely want to upgrade to based on its current version. Note that if this notification is being received by a given cluster, it means that this version is currently available as an upgrade target in that cluster's location.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :affectedSupportedMinors => list(String.t()) | nil,
          :briefDescription => String.t() | nil,
          :bulletinId => String.t() | nil,
          :bulletinUri => String.t() | nil,
          :cveIds => list(String.t()) | nil,
          :manualStepsRequired => boolean() | nil,
          :mitigatedVersions => list(String.t()) | nil,
          :patchedVersions => list(String.t()) | nil,
          :resourceTypeAffected => String.t() | nil,
          :severity => String.t() | nil,
          :suggestedUpgradeTarget => String.t() | nil
        }

  field(:affectedSupportedMinors, type: :list)
  field(:briefDescription)
  field(:bulletinId)
  field(:bulletinUri)
  field(:cveIds, type: :list)
  field(:manualStepsRequired)
  field(:mitigatedVersions, type: :list)
  field(:patchedVersions, type: :list)
  field(:resourceTypeAffected)
  field(:severity)
  field(:suggestedUpgradeTarget)
end

defimpl Poison.Decoder, for: GoogleApi.Container.V1.Model.SecurityBulletinEvent do
  def decode(value, options) do
    GoogleApi.Container.V1.Model.SecurityBulletinEvent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Container.V1.Model.SecurityBulletinEvent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
